import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import s_get from '@dfeidao/atom-web/storage/get';
import { IFeidaoAiBrowserComponent } from '@dfeidao/web/interfaces';

import get from '@dfeidao/atom-web/local/get';
import remove from '@dfeidao/atom-web/local/remove';

import P03 from './P03';



export default async function a007(fd: IFeidaoAiBrowserComponent) {

	if (get(fd, 'curr_dept')) {
		remove(fd, 'curr_dept');
	}


	// const user = await whoami(get_user_info);

	const productid = await s_get('productid');

	const systemid = fd.data.node.querySelector<HTMLSelectElement>('#zj3systemid').value;
	const res1 = await nodejs<{ dataArray: string[] }>('menu/zj-000002/s002', { productid, systemid });
	render(fd, res1, P03, 'P03', 'inner');
}
